/* jshint indent: 2 */

module.exports = function(sequelize, DataTypes) {
  return sequelize.define('fShippingAddress', {
    id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      primaryKey: true,
      autoIncrement: true,
      field: 'id'
    },
    name: {
      type: DataTypes.STRING(120),
      allowNull: true,
      field: 'name'
    },
    address: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'address'
    },
    phone: {
      type: DataTypes.STRING(120),
      allowNull: true,
      field: 'phone'
    },
    isDefault: {
      type: DataTypes.INTEGER(1),
      allowNull: true,
      defaultValue: '0',
      field: 'is_default'
    },
    userId: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      field: 'user_id'
    }
  }, {
    tableName: 'f_shipping_address'
  });
};
